'use strict';
function includes(collection,ch){
  for(let item of collection){
    if(item===ch){
      return true;
    }
  }
  return false;
}
function createUpdatedCollection(collectionA, objectB) {
  let collectionB=objectB.value;
  for(let i=0;i<collectionA.length;i++){
    if(includes(collectionB,collectionA[i].key)){
      collectionA[i].count-=Math.floor(collectionA[i].count/3);
    }
  }
  console.log(collectionA);
  return collectionA;
}
module.exports =createUpdatedCollection;
createUpdatedCollection([
  {key: 'a', count: 3},
  {key: 'e', count: 7},
  {key: 'h', count: 11},
  {key: 't', count: 20},
  {key: 'f', count: 9},
  {key: 'c', count: 8},
  {key: 'g', count: 7},
  {key: 'b', count: 6},
  {key: 'd', count: 5}
], {value: ['a', 'd', 'e', 'f']});